package util;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Alex Vikharev vikharev@yandex-team.ru
 *         created 11.02.12
 */
public abstract class Function<X, Y> {
    abstract  public Y apply(X arg);
    
    public List<Y> apply(List<X> args){
        List<Y> res = new ArrayList<>(args.size());
        for (X arg : args) {
            res.add(apply(arg));
        }
        return res;
    }
}
